//  this library.
/// 练习试题相关数据
class PracticeModel {
  String? createdTime;
  String? modifyTime;
  String? id;
  int? categoryId;
  String? day;
  String? userId;
  int? qcount;
  int? continuityDay;
  String? name;
  int? joinCount;
  List<ContentPractice>? content;

  PracticeModel({
    this.createdTime,
    this.modifyTime,
    this.id,
    this.categoryId,
    this.day,
    this.userId,
    this.qcount,
    this.continuityDay,
    this.name,
    this.joinCount,
    this.content,
  });

  PracticeModel.fromJson(Map<String, dynamic> json) {
    createdTime = json['createdTime'];
    modifyTime = json['modifyTime'];
    id = json['id'];
    categoryId = json['categoryId'];
    day = json['day'];
    userId = json['userId'];
    qcount = json['qcount'];
    continuityDay = json['continuityDay'];
    name = json['name'];
    joinCount = json['joinCount'];
    if (json['content'] != null) {
      content = <ContentPractice>[];
      json['content'].forEach((v) {
        content!.add(ContentPractice.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['createdTime'] = createdTime;
    data['modifyTime'] = modifyTime;
    data['id'] = id;
    data['categoryId'] = categoryId;
    data['day'] = day;
    data['userId'] = userId;
    data['qcount'] = qcount;
    data['continuityDay'] = continuityDay;
    data['name'] = name;
    data['joinCount'] = joinCount;
    if (content != null) {
      data['content'] = content!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ContentPractice {
  String? tyName;
  String? desc;
  double? score;
  int? sort;
  List<QsPractice>? qs;

  ContentPractice({this.tyName, this.desc, this.score, this.sort, this.qs});

  ContentPractice.fromJson(Map<String, dynamic> json) {
    tyName = json['tyName'];
    desc = json['desc'];
    if (json["score"] != null) {
      score = double.parse(json['score'].toString());
    }
    sort = json['sort'];
    if (json['qs'] != null) {
      qs = <QsPractice>[];
      json['qs'].forEach((v) {
        qs!.add(QsPractice.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['tyName'] = tyName;
    data['desc'] = desc;
    data['score'] = score;
    data['sort'] = sort;
    if (qs != null) {
      data['qs'] = qs!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class QsPractice {
  String? id;
  int? sort;
  double? score;

  QsPractice({
    this.id,
    this.sort,
    this.score,
  });

  QsPractice.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sort = json['sort'];
    if (json["score"] != null) {
      score = double.parse(json['score'].toString());
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['sort'] = sort;
    data['score'] = score;
    return data;
  }
}
